package com.wang.myreflect;

import lombok.Data;

import java.io.IOException;

/**
 * @author yandong
 */
@Data
public class Student {
    private String name;
    private int age;
    public String gender;

    public Student() {}

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    protected Student(String name) {
        this.name = name;
    }

    private Student(int age) {
        this.age = age;
    }

    public void study() {
        System.out.println("Students are studying ...");
    }

    public void study(String subject) {
        System.out.println("Students are studying " + subject);
    }

    private String eat(String  food) throws IOException, NullPointerException, ClassCastException {
        System.out.println("Students are eating " + food);
        return "吃饱了";
    }

//    @Override
//    public String toString() {
//        return "Student{" +
//                "name='" + name + '\'' +
//                ", age=" + age +
//                '}';
//    }
}
